repo.or.cz
/
and.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
11110 - Equidivisions (DFS, maratón colombiana) &&
[and.git]
/
10098 - Generating fast, sorted permutation
/
10098.cpp
blob
eeb680dc1e36d1f1825b63870a87ac45fd887641
1
#include <iostream>
2
#include <algorithm>
3
#include <string>
4
5
using namespace
std
;
6
7
int
main
(){
8
int
n
;
9
cin
>>
n
;
10
while
(
n
--){
11
string s
;
12
cin
>>
s
;
13
sort
(
s
.
begin
(),
s
.
end
());
14
do
{
15
cout
<<
s
<<
endl
;
16
}
while
(
next_permutation
(
s
.
begin
(),
s
.
end
()));
17
cout
<<
endl
;
18
}
19
return
0
;
20
}